package com.enhe.gck.service.impl;

import com.enhe.gck.item.ConfigHWANE16627Item;
import com.enhe.gck.pojo.Config;
import com.kuangkie.carbon.panel.CarbonPanel;
import org.springframework.stereotype.Service;

import java.util.Optional;

import static com.enhe.gck.CarbonBaseConstant.参数配置_cspz;

/**
 * 参数配置service
 */
@Service
public class ConfigService {

    /**
     * 获取参数配置
     */
    public Optional<Config> getConfig(Long configType) {
        Config config = CarbonPanel.getRecordQueryFactory(参数配置_cspz).getProConJunctionFactory()
                .addEqual(ConfigHWANE16627Item.基本属性组_类型, configType)
                .goBack()
                .queryABean(Config.class);
        if (null == config) {
            return Optional.empty();
        }
        return Optional.of(config);
    }

}
